﻿using AsmShaderConverter.AsmShader;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TestAsmConverter
{
    [TestClass]
    public class AsmShaderInputs
    {
        #region Public Methods

        [TestMethod]
        public void TestMethod1()
        {
            AsmShaderFile asm = new AsmShaderFile(AsmShaderHelper.ShaderType.VertexShader, AsmShaderHelper.ShaderVersion.V5_0);
            string Input = "dcl_texcoord8 v1";

            var input = new AsmShaderInputOutput(Input);

            string hlsl = input.ToHLSL(asm);

            Assert.AreEqual(hlsl, "float4 v1 : texcoord8");
        }

        [TestMethod]
        public void TestMethod2()
        {
            AsmShaderFile asm = new AsmShaderFile(AsmShaderHelper.ShaderType.VertexShader, AsmShaderHelper.ShaderVersion.V5_0);
            string Input = "dcl_texcoord v2.xyz";

            var input = new AsmShaderInputOutput(Input);

            string hlsl = input.ToHLSL(asm);

            Assert.AreEqual(hlsl, "float3 v2 : texcoord");
        }

        [TestMethod]
        public void TestMethod3()
        {
            AsmShaderFile asm = new AsmShaderFile(AsmShaderHelper.ShaderType.VertexShader, AsmShaderHelper.ShaderVersion.V5_0);
            string Input = "dcl_texcoord4 v5.xy";

            var input = new AsmShaderInputOutput(Input);

            string hlsl = input.ToHLSL(asm);

            Assert.AreEqual(hlsl, "float2 v5 : texcoord4");
        }

        [TestMethod]
        public void TestMethod4()
        {
            AsmShaderFile asm = new AsmShaderFile(AsmShaderHelper.ShaderType.VertexShader, AsmShaderHelper.ShaderVersion.V5_0);
            string Input = "dcl_texcoord4 v5.x";

            var input = new AsmShaderInputOutput(Input);

            string hlsl = input.ToHLSL(asm);

            Assert.AreEqual(hlsl, "float v5 : texcoord4");
        }

        [TestMethod]
        public void TestMethod5()
        {
            AsmShaderFile asm = new AsmShaderFile(AsmShaderHelper.ShaderType.VertexShader, AsmShaderHelper.ShaderVersion.V5_0);
            string Input = "dcl_color v0.xyw";

            var input = new AsmShaderInputOutput(Input);

            string hlsl = input.ToHLSL(asm);

            Assert.AreEqual(hlsl, "float4 v0 : color");
        }

        [TestMethod]
        public void TestMethod6()
        {
            AsmShaderFile asm = new AsmShaderFile(AsmShaderHelper.ShaderType.VertexShader, AsmShaderHelper.ShaderVersion.V5_0);
            string Input = "dcl_texcoord4 v5.w";

            var input = new AsmShaderInputOutput(Input);

            string hlsl = input.ToHLSL(asm);

            Assert.AreEqual(hlsl, "float4 v5 : texcoord4");
        }

        [TestMethod]
        public void TestMethod7()
        {
            AsmShaderFile asm = new AsmShaderFile(AsmShaderHelper.ShaderType.VertexShader, AsmShaderHelper.ShaderVersion.V5_0);
            string Input = "dcl_texcoord4 v5.z";

            var input = new AsmShaderInputOutput(Input);

            string hlsl = input.ToHLSL(asm);

            Assert.AreEqual(hlsl, "float3 v5 : texcoord4");
        }

        #endregion Public Methods
    }
}